import request from "../utils/request";
//获取验证码
export let getCaptcha = () => request.get("/users/getCaptcha?v=next");

//校验验证码
export let verifyCaptcha = (captcha) =>
  request.get("/users/verifyCaptcha", {
    params: { captcha },
  });

//用户名登录
export let userLogin = (username, password) =>
  request.post("/users/login", {
    username,
    password,
  });

//获取手机验证码
export let getMobileCode = (phoneNumber) => {
  return request.post("/sms/send", { phoneNumber });
};

//手机号登录
export let mobileLogin = (code) => {
  return request.post("/users/login?type=sms", { code });
};

//获取二维码
export let getQrcodeUrl = (sid) =>
  request.get("/users/getQrcode", { params: { sid } });

//微信登录
export let weCatLogin = (wechatCode) =>
  request.get("/users/wechatLogin", { params: { wechatCode } });
